home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / comm / iprv094.zip / IPROUTE.TXT < prev    next >
Text File  |  1996-07-31  |  51KB  |  1,558 lines

  1. Copyright 1995, 1996 David F. Mischler
  2. See the file README.1ST for license information
  3.  
  4.  
  5.             IPRoute PC-based Router V0.94
  6.  
  7.     IPRoute is a software package that routes Internet Protocol
  8.     (IP) packets between network interfaces on PC hardware.  It
  9.     requires a 286 or better CPU. It is intended to be useful
  10.     for connecting a LAN to an Internet Service Provider, or for
  11.     routing between LANs.  It provides the following features:
  12.  
  13.     * Multiple ethernet interfaces.
  14.  
  15.     * SLIP, CSLIP and asynchronous PPP serial links.
  16.  
  17.     * Demand-dial and answer scripting.
  18.  
  19.     * IP packet filtering.
  20.  
  21.     * Network Address Translation (NAT).
  22.  
  23.     * Packet and event logging to a syslog daemon.
  24.  
  25.     * Routing Information Protocol (RIP).
  26.  
  27.     * Multiple transmit queue management strategies.
  28.  
  29.     * Administrative preference on routes.
  30.  
  31.     * IP tunnelling over ESP using DES-CBC (for US citizens and
  32.       permanent residents only; not exportable at this time).
  33.  
  34.  
  35.  
  36.    THIS SOFTWARE IS PROVIDED "AS-IS".  THE AUTHOR IS NOT RESPONSIBLE
  37.    FOR ANY DAMAGES CAUSED BY THE USE OR MISUSE OF THE SOFTWARE, EVEN
  38.    IF INFORMED OF THE POSSIBILITY OF THESE DAMAGES IN WRITING.  THE
  39.    AUTHOR MAKES NO COMMITMENT REGARDING THE USABILITY OF THE SOFTWARE
  40.    OR ITS FITNESS FOR A PARTICULAR PURPOSE.
  41.  
  42.  
  43.  
  44.             SUPPORTED INTERFACES
  45.  
  46.     An ethernet interface may be configured by attaching to a
  47.     packet driver loaded before IPRoute was started with the
  48.     "packet" command.  There is no hard-coded limit on the number
  49.     of packet drivers allowed, but I have never tested more than
  50.     two.  Packet drivers from the Crynwr Packet Driver Release 11
  51.     or later are recommended.  At present, only class 1 (ethernet)
  52.     packet drivers are supported.  Only ethernet packet headers are
  53.     supported (i.e. IEEE 802.3 headers are not supported).
  54.  
  55.     Asynchronous serial ports using the standard PC UARTS (i.e.
  56.     8250/16450/16550) are supported.  These interfaces may be
  57.     configured with the "async", "slip", "ppp" and "command"
  58.     commands.  The 16550 FIFOs are used to provide far better
  59.     performance than with the other UARTS.
  60.  
  61.  
  62.  
  63.             MODEM CONFIGURATION
  64.  
  65.     IPRoute can be configured to work with almost any modem, but
  66.     certain modem settings are expected.  Unfortunately, modem
  67.     configuration commands are not standard enough for me to tell
  68.     you exactly what commands are needed to configure your modem.
  69.     IPRoute will generally work best when your modem is set for
  70.     8-bit data with no parity and hardware flow control.  The
  71.     data terminal ready (DTR) and carrier detect (CD) control
  72.     signals should work as "normal" (i.e. a DTR transition from
  73.     on to off will hang up the phone line, and CD will be on
  74.     if and only if there is a connection to a remote modem).
  75.     You may set your modem to return extended result codes if
  76.     you wish to receive more information on each connection.
  77.  
  78.  
  79.  
  80.                 COMMAND ENTRY
  81.  
  82.     All router commands must be entered in lower case.  There
  83.     are several special purpose characters.  The backspace or
  84.     delete characters will erase the last character typed, and
  85.     the Ctrl-U character will erase the entire line.  The enter
  86.     key must be typed before a command will be executed.  When
  87.     a question mark is entered as a command component the
  88.     command syntax or options available for the partial command
  89.     will be displayed (try "route ?" for an example).
  90.  
  91.  
  92.  
  93.                 SCRIPTING
  94.  
  95.     IPRoute is normally provided a script file at startup.  The
  96.     script file contains commands to be executed in a particular
  97.     order under specified conditions.  It is possible to specify
  98.     packet, modem control signal, and timing events.  A script
  99.     processing task is normally run at startup, and additional
  100.     script processors may be started for each asynchronous
  101.     interface.  This makes it possible for different interfaces
  102.     to execute scripted commands independently.
  103.  
  104.     When a script command requires a string it should be enclosed
  105.     in double quotes.  The backslash character may be used as an
  106.     escape for various control characters.  In particular, \r is
  107.     used to represent a carriage return, \n represents a line
  108.     feed, \" represents an embedded double quote, and \\ represents
  109.     a backslash.
  110.  
  111.     It is possible to define symbols for use in scripts with the
  112.     "define" and "read" commands.  The symbols must be preceded by
  113.     a dollar sign to be expanded.  Dollar signs in quoted strings
  114.     must be preceded by a backslash unless symbol substitution is
  115.     desired.
  116.  
  117.     Whenever a script process transfers control due to an enabled
  118.     "on" event, all "on" events are disabled.
  119.  
  120.     The command reference includes many details about scripting.
  121.  
  122.  
  123.  
  124.             PACKET FILTERING
  125.  
  126.     Packet filtering can be a useful security tool.  It is
  127.     imperative that the network administrator understand how
  128.     filtering improves security, and that it be used wisely.
  129.     Most experts on packet filtering recommend that you only
  130.     allow the packets through your filters that are required
  131.     to provide the services you need, and drop all others.
  132.     The best introduction to packet filtering that I know of
  133.     is Brent Chapman's "Network (In)Security Through IP
  134.     Packet Filtering", available in PostScript by anonymous
  135.     FTP from ftp.GreatCircle.COM.  The directory path has
  136.     changed a few times, but the file is still called
  137.     pkt_filtering.ps.Z.
  138.  
  139.     A filtered interface has two separate lists of filtering
  140.     rules: one for inbound packets, and one for outbound
  141.     packets.  As packets enter or leave the router on a
  142.     filtered interface they are checked against each filter
  143.     rule in the order the rules were specified until a match
  144.     occurs, or the end of the filter list is reached.  When
  145.     a match occurs the actions specified in the filter rule
  146.     are performed on that packet.  Packets that do not match
  147.     any filter rules will be silently dropped if a filter list
  148.     exists on the interface for the packet's direction.
  149.  
  150.     IP fragments, except for the initial fragment, are not
  151.     completely filtered because they do not contain port
  152.     numbers.  It is possible for some data to "leak" or be
  153.     tunnelled past the filter.  In general, this is not a
  154.     serious problem because normal TCP/IP implementations
  155.     will drop the data if the initial fragments are not
  156.     received.  If you are concerned about packet sniffing or
  157.     deliberate fragment tunneling then I recommend that you
  158.     couple NAT with filtering because NAT drops IP fragments
  159.     whose datagram IDs do not match recently forwarded
  160.     initial fragments.  Please note that a determined user
  161.     of your internal network might still find a way to
  162.     tunnel past your filtering scheme.  I can not think of
  163.     any way to make this absolutely impossible.
  164.  
  165.     The present implementation drops any initial or only
  166.     fragment that is too short to contain all of its protocol
  167.     headers (including the TCP, UDP, or ICMP header), and TCP
  168.     packets with an IP fragment offset of 1.  This prevents
  169.     certain types of attempts to bypass filtering.
  170.  
  171.     Filtering has some performance impact.  This impact can
  172.     be minimized by constructing your filter lists so that,
  173.     on average, the fewest possible filter rules are checked
  174.     for each packet.  For example, placing a rule that
  175.     matches all TCP packets that are not connection open
  176.     attempts (i.e. filter protocol "tcp-xsyn") at the start
  177.     of the list should improve things a lot.
  178.  
  179.  
  180.  
  181.  
  182.             NETWORK ADDRESS TRANSLATION
  183.  
  184.     Network Address Translation (NAT) allows a network with
  185.     non-global addresses to connect to the Internet.  This
  186.     is done by assigning one or more globally valid addresses
  187.     to the external interface of the router and specifying
  188.     how addresses and port numbers are to be translated.
  189.  
  190.     NAT can be a good security tool for situations where a
  191.     (potentially) large number of external services are
  192.     desired by the internal users, but only a few services
  193.     should be provided to the outside world.  In particular,
  194.     NAT can solve the problem of handling inbound FTP data
  195.     connections without making all high-numbered TCP ports
  196.     vulnerable from the outside.  This problem has plagued
  197.     most packet filtering schemes.
  198.  
  199.     Two separate tables are maintained for each interface
  200.     running NAT.  One table, the NAT configuration list, is
  201.     entered as part of the router configuration.  It provides
  202.     a set of rules for setting up new NAT connections.  It is
  203.     always scanned in the order in which the rules were given.
  204.     The other table is constructed dynamically by the router
  205.     with one entry for each active translated connection.
  206.  
  207.     When a packet representing a new connection comes in on a
  208.     translated interface it is compared to each entry in the
  209.     NAT configuration list.  A protocol of "*" will match any
  210.     incoming protocol, but the internal and external IP
  211.     addresses must be specified.  The port numbers must be
  212.     provided unless neither is given (this indicates that the
  213.     same port numbers should be used internally as externally).
  214.     These rules provide enough flexibility for an external
  215.     address and port to be translated to an internal address
  216.     and port, or for an external address to be translated to
  217.     an internal address without port translation.  Note that
  218.     if port numbers are not specified then no service filtering
  219.     can be performed by NAT.
  220.  
  221.     The rules are somewhat different for outgoing connections.
  222.     When a packet representing a new connection goes out on a
  223.     translated interface it is compared to each entry in the
  224.     NAT configuration list.  A protocol of "*" will match any
  225.     outgoing protocol, and an internal address of "*" will
  226.     match any internal address.  Neither port number is
  227.     usually specified, but it is sometimes necessary to set
  228.     the external port number to be assigned for use with an
  229.     internal port number (e.g. outgoing FTP data connections
  230.     so that the remote system will see the connection
  231.     originate from port 20 rather than a "random" port).  It
  232.     is also legal (but maybe a little weird) to use "*" for
  233.     both the internal and external IP addresses, in which case
  234.     neither the addresses nor port numbers will be translated,
  235.     but the connection establishment and tracking rules will be
  236.     enforced.
  237.  
  238.     It should be noted that packets that enter the router on
  239.     a translated interface will have only their destination
  240.     address and port number translated.  Packets that leave
  241.     the router on a translated interface will have only their
  242.     source address and port number translated.  It is possible
  243.     to perform "double-blind" translation by enabling NAT on
  244.     two interfaces, but it is not possible to connect two
  245.     networks with the same address using this technique.
  246.  
  247.     An interface that runs NAT must always have an IP
  248.     address that is valid on the external network to which
  249.     it is connected.  This is because ICMP error messages
  250.     may be generated and sent out this interface using the
  251.     interface's assigned address.
  252.  
  253.     If an interface has both filtering and NAT enabled then
  254.     filtering is always performed first, then translation,
  255.     except in a few cases where ICMP error messages or TCP
  256.     resets are generated on the "wrong side" of NAT.  This
  257.     has implications on exactly what can be filtered, logged,
  258.     and translated.
  259.  
  260.     The present implementation drops any initial or only
  261.     fragment that is too short to contain all of its protocol
  262.     headers (including the TCP, UDP, or ICMP header), and TCP
  263.     packets with an IP fragment offset of 1.  This prevents
  264.     certain types of attempts to fool NAT.
  265.  
  266.     When NAT is used with PPP with dynamic IP addresses and
  267.     the NAT external address must correspond to the IP address
  268.     negotiated by PPP the PPP option "dynamic-nat" should be
  269.     used.  This causes the external IP address of each NAT
  270.     list entry to be set to the negotiated IP address, all
  271.     packets with the wrong IP source address to be dropped
  272.     from the outgoing interface queue, and all dynamic NAT
  273.     table entries with the wrong external IP address to be
  274.     deleted.  Note that if you are using a dynamically
  275.     addressed PPP link to route to a fixed IP network then
  276.     this option must not be used.
  277.  
  278.  
  279.  
  280.             WHO NEEDS NAT?
  281.  
  282.     Several users have told me that IPRoute doesn't work for
  283.     them unless they enable NAT.  Invariably, this is either
  284.     because they are using unregistered IP addresses, or their
  285.     Internet Service Provider is not correctly routing packets
  286.     to their sites for the IP addresses in use.  In either
  287.     case, ordinary routing will not work so NAT is required.
  288.  
  289.  
  290.  
  291.         PORT NUMBERS, SERVICES, AND PROTOCOLS
  292.  
  293.     This information is provided as reference material to
  294.     assist network administrators.  Various network services
  295.     are discussed with regard to protocol and port numbers.
  296.     Most of this information comes from the "Assigned Numbers"
  297.     RFC, which at the time of this writing was RFC 1700.
  298.  
  299.     DNS is implemented as both a TCP and UDP service to port
  300.     53 on the destination machine.  Zone transfers and lists
  301.     are performed using TCP, so many security experts
  302.     recommend that machines other than your authoritative
  303.     secondary DNS servers should be prevented from connecting
  304.     to TCP port 53 (this could be a job for packet filtering),
  305.     unless you are controlling zone transfers and listings by
  306.     some other technique.  Client to server communication is
  307.     generally from arbitrary client ports greater than 1023,
  308.     but server to server communication generally uses UDP port
  309.     53 for both the source and destination.
  310.  
  311.     FINGER is implemented as a TCP service to port 79 on the
  312.     destination machine.  In practice, the TCP port on the
  313.     client machine is 1024 or greater, although this is not
  314.     a protocol requirement.
  315.  
  316.     FTP is the most complicated service in common use.  It
  317.     uses a TCP service to port 21 on the destination machine
  318.     to provide a control channel, and connects back from the
  319.     server's TCP port 20 to a port specified by the client
  320.     machine to provide the data channel.  This means that FTP
  321.     control streams must be monitored by NAT to allow the
  322.     data connections to succeed.  Some servers incorrectly use
  323.     a source port other than 20.  If you need to operate with
  324.     a server that is broken in this manner then tell NAT about
  325.     it with the "set nat ftp-data-any on" command.  There is also
  326.     a less common technique ("PASV" mode) that allows the client
  327.     to connect outward to the server for data connections.  If
  328.     you need to allow incoming passive FTP then you should tell
  329.     NAT with the "set nat ftp-pasv on" command.
  330.  
  331.     HTTP (web service) is implemented as a TCP service to port
  332.     80 on the destination machine.  The client machine's port
  333.     is almost always 1024 or greater.
  334.  
  335.     NNTP is implemented as a TCP (or UDP?) service to port
  336.     119 on the destination machine.  In practice, the TCP port
  337.     on the client machine is 1024 or greater, although this is
  338.     not a protocol requirement.
  339.  
  340.     NTP is implemented as a UDP (or TCP?) service to port 123
  341.     on the destination machine.  Some client functions use
  342.     arbitrary ports greater than 1023, but server to server
  343.     UDP communication uses port 123 on both ends.
  344.  
  345.     PING is normally implemented to send ICMP echo requests
  346.     and receive ICMP echo replies.
  347.  
  348.     SMTP (mail) is implemented as a TCP service to port 25 on
  349.     the destination machine.  In practice, the TCP port on
  350.     the machine sending the mail is 1024 or greater, although
  351.     this is not a protocol requirement.
  352.  
  353.     TELNET is implemented as a TCP service to port 23 on the
  354.     destination machine.  In practice, the TCP port on the
  355.     client machine is 1024 or greater, although this is not
  356.     a protocol requirement.
  357.  
  358.     TRACEROUTE sends UDP datagrams to the target machine at
  359.     arbitrary port numbers (usually above 32768), and with
  360.     the IP TTL field initially set to 1 and increasing for
  361.     each hop.  The destination port number is changed for
  362.     each hop as well.  Each IP router decrements the TTL,
  363.     and the router that decrements it to 0 sends back an
  364.     ICMP Time Exceeded (type 11), TTL Exceeded (code 0)
  365.     message.  The target machine should send back an ICMP
  366.     Destination Unreachable (type 3), Port Unreachable
  367.     (code 3).  Microsoft's TRACERT send ICMP echo requests
  368.     with a varying time to live rather than UDP messages.
  369.  
  370.  
  371.  
  372.             LOGGING
  373.  
  374.     Events can be logged to a file or a UDP server.  Filter
  375.     entries, as well as various flags, control what is logged.
  376.     See the "set log" commands for more information.
  377.  
  378.  
  379.  
  380.             RIP
  381.  
  382.     The present RIP implementation is based mostly on RFC 1058.
  383.     Split horizon is always enabled.  RIP requests are not
  384.     generated or responded to, and no triggered updates are sent.
  385.     Routes learned by RIP are poisoned for approximately 2 minutes
  386.     when lost.  An administrative preference value may be assigned
  387.         to routes learned on each interface.  See the "rip" command
  388.     description for more info.
  389.  
  390.  
  391.  
  392.             TRANSMIT QUEUING
  393.  
  394.     All transmit queues are limited.  This means that packets
  395.     will be dropped if the limit is exceeded.  In addition,
  396.     all transmit queues are aged every few seconds if packets
  397.     are not being transmitted on the interface.  During queue
  398.     aging, the time each packet was queued for output is
  399.     examined, and any packet whose remaining IP time-to-live
  400.     (TTL) is less than the time that it has been on the queue
  401.     is dropped.  The TTL of packets that are not dropped is
  402.     not affected by this process.  This behavior is intended
  403.     to prevent router constipation caused by an interface
  404.     that fails, or whose modem dropped, etc.
  405.  
  406.     If transmit queuing is set to "fifo" then packets are
  407.     always sent in the order they were queued.  In addition,
  408.     if packets must be dropped due to queue limiting then
  409.     the first packet on the queue will be dropped.  This
  410.     queuing strategy is especially good for fast interfaces,
  411.     like ethernet, where the computational overhead of
  412.     priority queuing would hurt performance, and provide
  413.     little or no benefit.  The optimal tradeoff between link
  414.     speed and queuing strategy is dependent on the hardware
  415.     and network characteristics.
  416.  
  417.     If transmit queuing is set to "priority" then packets are
  418.     sent in priority order.  The present algorithm uses the
  419.     IP precedence and type of service to determine a send
  420.     priority and a save priority.  Precedence has a greater
  421.     effect on these priorities than the type of service.
  422.     Packets are sent in the order of highest send priority
  423.     first, and are dropped in the order of lowest save
  424.     priority first.  This queuing strategy is especially
  425.     good for low-speed SLIP lines, where interactive users
  426.     will benefit from the improved response time, and high
  427.     reliability services will benefit from fewer packet drops
  428.     under congested conditions.  Perhaps the biggest weakness
  429.     of this strategy is that there are still some  TCP/IP
  430.     implementations that do not set the type of service as
  431.     required by RFC 1122.
  432.  
  433.     If transmit queuing is set to "fair" then packets are
  434.     sent in priority order, but the priority of any packet
  435.     directly preceded by a newer packet is increased by one.
  436.     This has the effect of providing better response time
  437.     than FIFO queuing, but fairer service distribution than
  438.     strict priority queuing.  This queuing strategy is most
  439.     useful when FIFO queuing provides decent throughput but
  440.     inadequate response, and priority queuing provides OK
  441.     response but lousy throughput.  It is also less subject
  442.     to abuse than strict priority routing (e.g. smart users
  443.     might start doing high-priority file transfers).  It has,
  444.     however, a slightly higher computational overhead than
  445.     the priority queuing strategy.
  446.  
  447.     By default, all async lines use priority queuing, and
  448.     all ethernet interfaces use FIFO queuing.
  449.  
  450.  
  451.  
  452.             ADMINISTRATIVE PREFERENCE
  453.  
  454.     Each routing table entry includes an administrative preference
  455.     value.  Lower preference values indicate that a route should be
  456.     preferred over another route with a higher preference value.
  457.     This can be used to control backup routes, etc.  By default, the
  458.     preference value for all routes is 1.  This may be overridden
  459.     when a static route is created, or by interface for RIP.
  460.  
  461.  
  462.  
  463.             ENCRYPTED IP TUNNELLING
  464.  
  465.     An encrypted IP tunnel can be created with the US-only
  466.     version of IPRoute using the "tunnel" and "esp" commands.
  467.     Under current US regulations these functions cannot be
  468.     exported or provided to persons that are not citizens or
  469.     permanent residents of the United States.
  470.  
  471.     An encrypted security payload (ESP) tunnel allows secure
  472.     operation of a virtual private network over insecure networks,
  473.     including the Internet.  At the present time only DES-CBC with
  474.     manual key distribution is supported.  Due to the short (56
  475.     bit effective) key this encryption technology is not suitable
  476.     for protecting military secrets or information worth millions
  477.     of dollars.  The security is sufficient, however, to make
  478.     spoofing very difficult.
  479.  
  480.     An ESP tunnel is created by routing packets to the
  481.     destination network(s) through a tunnel driver, and
  482.     specifying encryption and decryption keys.  Each key has
  483.     an associated security parameters index (SPI).  Outgoing
  484.     TCP/IP packets routed through the tunnel driver will be
  485.     encrypted and encapsulated in an ESP/IP packet.  Incoming
  486.     ESP packets will be matched by source IP address and SPI
  487.     so that the appropriate key can be used to decrypt the
  488.     encapsulated packet so it may be forwarded.  Only true
  489.     point to point tunnels are supported.
  490.  
  491.     Users should be aware that ESP tunnelling has a negative
  492.     effect on throughput because the resulting packets are
  493.     larger than the original packets, and are not compressible
  494.     using any common compression algorithms.
  495.  
  496.  
  497.  
  498.             COMMAND REFERENCE
  499.  
  500. Warning: all router commands must be in lower case.
  501.  
  502.  
  503.  
  504. async <iface> <I/O addr> <IRQ> <speed> [<label>]
  505.  
  506.     Configures a standard 8250/16450/16550 serial port for
  507.     use by the router.  Many other commands can make use of
  508.     the interface after it is configured.  Of particular
  509.     interest are the "command" and "slip" commands, as well
  510.     as the "send" and "wait" commands for scripting.  If a
  511.     script label is provided then a new script processor will
  512.     be created that will begin execution at the specified
  513.     label, and will assume the interface created by this
  514.     command is meant whenever an interface name is required,
  515.     but missing.
  516.  
  517.     The example below configures the standard PC COM1 port
  518.     with the name "sl0" and a speed of 9600 bits per second.
  519.     The interface will be configured in "raw" mode unless a
  520.     command, such as "slip" changes the encapsulation.
  521.  
  522.     async sl0 0x3f8 4 9600
  523.  
  524.  
  525. backoff <symbol> <max value>
  526.  
  527.     Doubles the numeric value stored in the named symbol, and
  528.     limits the result to the maximum value specified.  This is
  529.     useful for adjusting redial delays when failures occur.
  530.     This command will be eliminated if/when general expression
  531.     evaluation is implemented.
  532.  
  533.  
  534.  
  535. command <iface>
  536.  
  537.     Starts an interactive command interpreter on the specified
  538.     interface.  At present, only async interfaces are suitable.
  539.  
  540.     The example below starts a command interpreter on sl0.
  541.  
  542.     command sl0
  543.  
  544.  
  545.  
  546. define <symbol> <string>
  547.  
  548.     Only usable in scripts.  Defines a script symbol with the
  549.     supplied double-quoted string as its value.  The symbol
  550.     may then be expanded later in the script by immediately
  551.     preceding it with a dollar sign.
  552.  
  553.  
  554.  
  555. delay <interval>
  556.  
  557.     Delays the specified number of seconds before returning.
  558.     Internal times are maintained in milliseconds, with a
  559.     resolution of 25 mS.
  560.  
  561.     The following example delays for 1.125 seconds.
  562.  
  563.     delay 1.125
  564.  
  565.  
  566.  
  567. detach <iface>
  568.  
  569.     Intended to disconnects from the hardware and eliminate
  570.     everything created for an interface.  Probably buggy as hell
  571.     at this time.  For now, I recommend you shut down the router
  572.     and restart it to eliminate an interface.
  573.  
  574.  
  575.  
  576. drop filter <iface>
  577.  
  578.     Drops all of the packet filter entries previously set up
  579.     for an interface with the "filter" command.  Essentially
  580.     turns off filtering on an interface.
  581.  
  582.  
  583.  
  584. drop nat <iface>
  585.  
  586.     Drops all of the network address translation information
  587.     previously set up for an interface with the "nat" command.
  588.     Also drops all connection state information.  Essentially
  589.     turns off address translation on an interface.
  590.  
  591.  
  592.  
  593. drop packets <iface>
  594.  
  595.     Drops all of the outgoing packets queued on an interface.
  596.     This might be useful for dynamic addressing.
  597.  
  598.  
  599.  
  600. drop route <addr/bits> <iface> [<router addr>] [metric <metric>]
  601.         [preference <pref>] [perm]
  602.  
  603.     Drops the route from the routing table that matches the
  604.     supplied information.
  605.  
  606.  
  607.  
  608. esp <iface> {in,out} <spi> des-cbc <key>
  609.  
  610.     Associates an SPI and key with a tunnel driver for incoming
  611.     or outgoing ESP-tunnelled traffic.  The <spi> parameter
  612.     is a 32-bit number.  The key is a 64-bit number that must
  613.     be entered in hexadecimal.
  614.  
  615.  
  616.  
  617. exit
  618.  
  619.     Logs off an interactive command interpreter.  If you use
  620.     this command on the console you will probably be hitting
  621.     Ctrl-Alt-Del soon after.
  622.  
  623.  
  624.  
  625. filter <iface> [log] [nodial] {deny,drop,permit} {in,out} <proto> <src> <dest>
  626.  
  627.     Appends a packet filter rule to the incoming or outgoing
  628.     list for the specified interface.
  629.  
  630.     If the optional "log" qualifier is present, then packets
  631.     that match the rule will be passed to the logger.  The
  632.     logging commands control exactly what is logged and where
  633.     it goes.
  634.  
  635.     If the optional "nodial" qualifier is present, then
  636.     packets that match the rule will be silently dropped if
  637.     the interface is in "raw" mode.  This is useful for
  638.     preventing "noise" packets from establishing a link,
  639.     but allowing them to be transported if the link is up.
  640.  
  641.     One of the action keywords "deny", "drop", or "permit"
  642.     must be specified.  The "deny" action is to drop the
  643.     matching packet and send an ICMP destination unreachable
  644.     message back to the packet's originator; the "drop"
  645.     action is to silently drop the packet, and the "permit"
  646.     action is to route the packet normally.
  647.  
  648.     A direction, "in" or "out", must be specified.  These
  649.     directions are from the router's viewpoint, i.e. "in"
  650.     refers to packets entering the router from the outside,
  651.     and "out" refers to packets leaving the router over the
  652.     filtered interface.
  653.  
  654.     The <proto> item is a protocol name or number.  The
  655.     following options are available:
  656.  
  657.     *        Matches any valid IP packet.
  658.     esp        Matches an ESP packet.
  659.     icmp    Matches any ICMP packet.
  660.     icmp-du    Matches an ICMP destination unreachable.
  661.     icmp-eq    Matches an ICMP echo request (ping).
  662.     icmp-er    Matches an ICMP echo reply (ping response).
  663.     icmp-pp    Matches an ICMP parameter problem message.
  664.     icmp-rd    Matches an ICMP redirect.
  665.     icmp-sq    Matches an ICMP source quench.
  666.     icmp-tx    Matches an ICMP time exceeded.
  667.     igmp    Matches an IGMP packet.
  668.     ip-ip    Matches an encapsulated-IP packet.
  669.     tcp        Matches any TCP packet.
  670.     tcp-syn    Matches TCP with SYN set and ACK clear.  This
  671.         indicates an attempt to open a new connection.
  672.     tcp-xsyn    Matches TCP with SYN clear or ACK set.  This
  673.         indicates a packet for an existing connection.
  674.     udp        Matches any UDP packet.
  675.     udp-zcs    Matches UDP packets with a zero checksum.
  676.  
  677.     The <src> and <dest> parameters specify the source and
  678.     destination IP addresses, masks, and TCP/UDP port numbers.
  679.     The syntax is [!]a[/w][:{p,p+,pl-ph}], which is just
  680.     about as confusing as it really is.  OK, here goes.  The
  681.     "a" represents an IP address in dotted decimal format, or
  682.     * to match all addresses.  The "/w" is the width of the
  683.     network mask in bits (e.g. 192.168.0.0/24 would match all
  684.     addresses whose first 24 bits are 192.168.0).  The "!"
  685.     negates the match on the address and mask only (not on
  686.     the ports).  If a port or port range is specified then it
  687.     is separated from the address part by a colon.  A single
  688.     port number may be specified, or a port number followed
  689.     by a plus sign (this represents ports p-65535), or a port
  690.     range may be specified with two port numbers separated by
  691.     a hyphen.
  692.  
  693.     The following example logs and silently drops attempts to
  694.     open a telnet connection to any hosts on network
  695.     192.168.0.0 that enter the router through interface sl0.
  696.  
  697.     filter sl0 log drop in tcp-syn * 192.168.0.0/24:23
  698.  
  699.  
  700.  
  701. goto <label>
  702.  
  703.     Only useful in scripts.  Causes an immediate and
  704.     unconditional transfer of control to the specified
  705.     label.  This command disables all "on" events.
  706.  
  707.  
  708.  
  709. log <string>
  710.  
  711.     Writes the supplied quoted string to the log.  This is
  712.     most useful when there are script symbols in the string.
  713.  
  714.  
  715.  
  716. nat <iface> <proto> <int addr:port> <ext addr:port>
  717.  
  718.     Appends a network address translation rule to the list
  719.     for the specified interface.  This list is only checked
  720.     when a packet that does not match an existing connection
  721.     enters or leaves the router on a translated interface.
  722.     It is used to control connection establishment.  It is
  723.     scanned linearly when a new connection is required.
  724.  
  725.     The <proto> item specifies the protocols that should be
  726.     allowed to open a new connection.  The following values
  727.     are recognized: "tcp", "udp", "icmp", "igmp", "ip-ip",
  728.     "esp" or "*" to match any recognized protocol.
  729.  
  730.     The <int addr:port> item specifies the internal machine
  731.     and/or port numbers that should be allowed access.  On
  732.     outgoing connections, both the address and port can be
  733.     "*" to indicate any internal machine and/or port.  On
  734.     incoming connections the address can only be "*" if the
  735.     external address is also "*" (this implies that the same
  736.     addresses must be used inside and out).  The port number
  737.     on incoming connections can likewise only be "*" if the
  738.     external port number is the same (and this disables port
  739.     number translation).
  740.  
  741.     The <ext addr:port> item specifies the address and/or
  742.     port numbers that should be used on the externally
  743.     visible network.  The address and port must always be
  744.     fully specified unless they are the same internally and
  745.     externally.  This is only useful for filtering traffic
  746.     based on established and approved connection information.
  747.     This can be useful because it provides a kind of dynamic
  748.     filtering that classic packet filtering can't do.
  749.  
  750.     The following example commands allow for a single external
  751.     address, 192.0.2.1, and an internal network 192.168.0.0.
  752.     All outgoing connections from the internal network are
  753.     permitted, plus SMTP mail from the outside is delivered
  754.     to 192.168.0.5, and FTP connections from the outside are
  755.     delivered to 192.168.0.9.  All other incoming connections
  756.     will be dropped.  Note that the third line isn't strictly
  757.     needed.  It establishes that outgoing FTP data connections
  758.     from the internal FTP host will use port 20 externally.
  759.     This helps keep all sorts of filtering and translating
  760.     schemes that depend on this behavior happy.
  761.  
  762.     nat sl0 tcp 192.168.0.5:25 192.0.2.1:25
  763.     nat sl0 tcp 192.168.0.9:21 192.0.2.1:21
  764.     nat sl0 tcp 192.168.0.9:20 192.0.2.1:20
  765.     nat sl0 *   *              192.0.2.1
  766.  
  767.  
  768.  
  769. on cd [<label>]
  770.  
  771.     Only useful in scripts.  Specifies that when CD becomes
  772.     active on an interface during a "wait" command the script
  773.     should resume execution at the specified label.  Leaving
  774.     off the label cancels any established label.
  775.  
  776.  
  777.  
  778. on cdloss [<label>]
  779.  
  780.     Only useful in scripts.  Specifies that when CD becomes
  781.     inactive on an interface during a "wait" command the script
  782.     should resume execution at the specified label.  Leaving
  783.     off the label cancels any established label.
  784.  
  785.  
  786.  
  787. on packet [<label>]
  788.  
  789.     Only useful in scripts.  Specifies that when a packet is
  790.     queued on an interface during a "wait" command the script
  791.     should resume execution at the specified label.  Leaving
  792.     off the label cancels any established label.
  793.  
  794.     A special form of this command exists, "on packet *", to
  795.     go to the script label associated with the routing table
  796.     entry for the packet's destination address.
  797.  
  798.  
  799.  
  800. on ring [<label>]
  801.  
  802.     Only useful in scripts.  Specifies that when RI becomes
  803.     active on an interface during a "wait" command the script
  804.     should resume execution at the specified label.  Leaving
  805.     off the label cancels any established label.
  806.  
  807.  
  808.  
  809. on timeout [<label>]
  810.  
  811.     Only useful in scripts.  Specifies that when a timeout
  812.     occurs during a "wait" or "slip" command the script should
  813.     resume execution at the specified label.  Leaving off the
  814.     label cancels any established label.
  815.  
  816.  
  817.  
  818. packet <iface> <int #> <addr/bits> [broadcast <brdcst addr>] [mtu <mtu>]
  819.  
  820.     Configures a device interfaced by a packet driver for
  821.     use by the router.  At present, only ethernet (class 1)
  822.     packet drivers are supported.
  823.  
  824.     The example below configures a packet driver using the
  825.     standard software interrupt 0x60, and indicates that the
  826.     interface IP address is 192.168.1.254, and the network
  827.     mask is 255.255.255.0.  By default the MTU is set to 1500
  828.     and 255.255.255.255 is used as the broadcast address.
  829.  
  830.     packet en0 0x60 192.168.1.254/24
  831.  
  832.  
  833.  
  834. ping <addr>
  835.  
  836.     Sends 5 ICMP echo requests to the specified address and
  837.     displays any replies received.
  838.  
  839.  
  840.  
  841. ppp <iface> <timeout> <addr/bits> [broadcast <brdcst addr>] [mtu <mtu>]
  842.         [dynamic-nat]
  843.  
  844.     Starts PPP on the specified interface.  The interface
  845.     will revert to "raw" mode if no packets are received for
  846.     <timeout> seconds, or if a carrier drop is detected, or if
  847.     the peer requests LCP link termination.  The IP address
  848.     and mask are treated like the ones in the "packet"
  849.     command, except that a "*" is used to indicate dynamic IP
  850.     address assignment.  If the "dynamic-nat" option is used
  851.     then when the local IP address is negotiated all entries
  852.     in the NAT list will be modified to use the negotiated
  853.     address externally, any active NAT connections with a
  854.     different external address will be removed, and any
  855.     outgoing queued packets with the wrong source IP address
  856.     will be dropped.
  857.  
  858.     If this command is typed in to a command interpreter then
  859.     a new process will be started to execute the command.  If
  860.     this command is part of a script then script execution
  861.     will pause until the interface reverts to raw mode.  If
  862.     this was due to a timeout or carrier drop then any enabled
  863.     "on" event for these conditions will be taken.
  864.  
  865.  
  866.  
  867. read <iface> <timeout> <terminator string> <symbol>
  868.  
  869.     Only usable in a script.  Reads a string ending with one
  870.     of the specified terminator characters into the specified
  871.     symbol.  The symbol may then be expanded later in the
  872.     script by immediately preceding it with a dollar sign.
  873.     This is intended for purposes like reading an IP address
  874.     from a SLIP server.
  875.  
  876.  
  877.  
  878. rip <iface> [default] [preference <pref>] [quiet] [{v1,v2,off}]
  879.  
  880.     Turns on/off RIP broadcasts on the specified interface.  By
  881.     default, the entire routing table will be sent in version
  882.     1 responses.  The "v2" qualifier causes RIP version 2
  883.     responses to be sent, but still broadcasts rather than
  884.     multicasts.  The "default" qualifier causes only a default
  885.     route to be broadcast rather than the real routing table.
  886.     The "preference" option specifies the administrative
  887.     preference to be assigned to routes learned via RIP on this
  888.     interface.  The "quiet" qualifier causes routes to be
  889.     learned but not distributed on this interface.
  890.  
  891.  
  892.  
  893. route <addr/bits> <iface> [<router addr>] [metric <metric>]
  894.         [preference <pref>] [perm] [label <label>]
  895.  
  896.     Adds a static route to the routing table.  The "perm"
  897.     qualifier is required if packets are to be routed to
  898.     an interface that is not encapsulating IP (e.g. an
  899.     async interface running a script that will dial and
  900.     establish a SLIP link when packets are queued to the
  901.     interface).
  902.  
  903.     The "label" parameter is for use with the "on packet *"
  904.     command.
  905.  
  906.  
  907.  
  908. send <iface> <string>
  909.  
  910.     Sends the quoted string out the specified interface.
  911.  
  912.  
  913.  
  914. set echo {off,on}
  915.  
  916.     Controls character echo while matching strings in a
  917.     "wait" command.
  918.  
  919.  
  920.  
  921. set filter deny-code <ICMP DU code>
  922.  
  923.     Sets the code carried in the ICMP destination unreachable
  924.     messages sent by the router when a packet matches a filter
  925.     rule whose action is "deny".  By default, the code is set
  926.     to 1 (host unreachable).  RFC 1812 says the value should
  927.     really be 13, but many hosts seem to ignore this code.
  928.  
  929.     The default will probably change in a future release.
  930.  
  931.  
  932.  
  933. set interface <iface> cd {ignore,normal}
  934.  
  935.     Controls the use of CD on an interface.  By default, CD
  936.     is used to detect modem disconnects.  The state of CD can
  937.     be ignored with the "ignore" qualifier.
  938.  
  939.  
  940.  
  941. set interface <iface> dtr {off,on}
  942.  
  943.     Controls the state of DTR on an interface.  By default,
  944.     DTR is low at the EIA interface.  This signal is used
  945.     to control modem answer and hangup.
  946.  
  947.  
  948.  
  949. set interface <iface> mtu <mtu>
  950.  
  951.     Sets the MTU on the specified interface.
  952.  
  953.  
  954.  
  955. set interface <iface> queue fair
  956.  
  957.     Sets the transmit queue for the specified interface
  958.     to queue (and drop) packets using a modified priority
  959.     algorithm with improved fairness.
  960.  
  961.  
  962.  
  963. set interface <iface> queue fifo
  964.  
  965.     Sets the transmit queue for the specified interface
  966.     to queue (and drop) packets in a FIFO manner.
  967.  
  968.  
  969.  
  970. set interface <iface> queue limit <limit>
  971.  
  972.     Sets the outgoing queue packet limit for the specified
  973.     interface.
  974.  
  975.  
  976. set interface <iface> queue priority
  977.  
  978.     Sets the transmit queue for the specified interface
  979.     to queue (and drop) packets in a prioritized manner.
  980.  
  981.  
  982.  
  983. set interface <iface> rts {flow,off,on}
  984.  
  985.     Controls the interface RTS line.  The "flow" qualifier
  986.     establishes RTS/CTS flow control.
  987.  
  988.  
  989.  
  990. set interface <iface> speed <bps>
  991.  
  992.     Controls the interface speed.
  993.  
  994.  
  995.  
  996. set log brief
  997.  
  998.     Reduces the data logged for each packet to 1 or 2 lines.
  999.     This is the default.
  1000.  
  1001.  
  1002.  
  1003. set log data
  1004.  
  1005.     Expands the data logged for each packet to the
  1006.     entire packet contents.
  1007.  
  1008.  
  1009.  
  1010. set log errors {off,on}
  1011.  
  1012.     Controls whether the router logs various errors.
  1013.     The default is "on".
  1014.  
  1015.  
  1016.  
  1017. set log file <filename>
  1018.  
  1019.     Specifies a file for the log data to be written to.
  1020.     "CON" specifies logging should be to the console display.
  1021.  
  1022.  
  1023.  
  1024. set log headers
  1025.  
  1026.     Expands the data logged for each packet to the
  1027.     IP and TCP/UDP/ICMP headers.
  1028.  
  1029.  
  1030.  
  1031. set log memory <lines>
  1032.  
  1033.     Specifies how many lines of the log are queued in memory.
  1034.     The default is 240.  Values over 2000 are not recommended.
  1035.  
  1036.  
  1037.  
  1038. set log monitor {off,on}
  1039.  
  1040.     Enables console display of all messages written to the log.
  1041.  
  1042.  
  1043.  
  1044. set log none
  1045.  
  1046.     Disables logging to a file or UDP server.
  1047.  
  1048.  
  1049.  
  1050. set log raw {off,on}
  1051.  
  1052.     Controls logging of raw device input received while
  1053.     executing "wait" commands.  This is especially useful
  1054.     for debugging dial/login scripts.  The default is off.
  1055.     This command only works in a script interpreter that
  1056.     is attached to the interface you want to log.
  1057.  
  1058.  
  1059.  
  1060. set log timestamp {off,on}
  1061.  
  1062.     Controls time stamping of log entries.  This should
  1063.     not be used if you are logging over the network and
  1064.     timestamping can be performed by the logging host
  1065.     because no attempt is made to synchronize the DOS
  1066.     clock with an outside source.  This feature is off
  1067.     by default.
  1068.  
  1069.  
  1070.  
  1071. set log udp <ip addr[:port]>
  1072.  
  1073.     Specifies that log entries should be sent to the UDP
  1074.     server at the specified IP address and port.  The format
  1075.     is suitable for use with the BSD syslog daemon.  If no
  1076.     port is specified then port 514 (syslog) is assumed.
  1077.  
  1078.  
  1079.  
  1080. set nat ftp-data-any {off,on}
  1081.  
  1082.     Specifies whether NAT will permit remote FTP servers
  1083.     to make incoming data connections to the client with
  1084.     a source port other than 20.  The default is off.
  1085.  
  1086.     WARNING: This will allow arbitrary TCP connections into
  1087.     your network with the internal endpoint specified by the
  1088.     FTP control stream.  This is probably safe, but it might
  1089.     make your network less secure to enable this feature.
  1090.  
  1091.  
  1092.  
  1093. set nat ftp-pasv {off,on}
  1094.  
  1095.     Specifies whether NAT will process incoming passive
  1096.     mode FTP connections correctly.  The default is off.
  1097.  
  1098.     WARNING: This will allow arbitrary TCP connections into
  1099.     your network with the internal endpoint specified by the
  1100.     FTP control stream.  This is probably safe, but it might
  1101.     make your network less secure to enable this feature.
  1102.  
  1103.  
  1104.  
  1105. set nat pass-icmp-errors {off,on}
  1106.  
  1107.     Specifies whether NAT will translate ICMP errors for
  1108.     open connections.  The default is on.
  1109.  
  1110.  
  1111.  
  1112. set nat ports <lowest port> <highest port>
  1113.  
  1114.     Specifies the range of port numbers used externally by NAT.
  1115.     The default is 1024 through 4999.
  1116.  
  1117.  
  1118.  
  1119. set nat send-icmp {off,on}
  1120.  
  1121.     Specifies whether NAT will attempt to cause bad/old
  1122.     connections to drop by sending ICMP messages.  This
  1123.     feature causes the router to spoof the IP address of the
  1124.     intended destination of the original packet.  The network
  1125.     administrator must beware, because things are not quite
  1126.     as they seem.  This feature is off by default.
  1127.  
  1128.  
  1129.  
  1130. set nat send-reset {off,on}
  1131.  
  1132.     Specifies whether NAT will attempt to cause bad/old
  1133.     connections to drop by sending TCP reset messages.  This
  1134.     feature causes the router to spoof the IP address of the
  1135.     intended destination of the original packet.  The network
  1136.     administrator must beware, because things are not quite
  1137.     as they seem.  This feature is off by default.
  1138.  
  1139.  
  1140.  
  1141. set ppp <iface> authenticate {off,chap,pap}
  1142.  
  1143.     Specifies the authentication protocol that the remote peer
  1144.     will be required to use for authentication.  The only CHAP
  1145.     algorithm available is the IETF standard CHAP based on MD5.
  1146.     This feature is off by default.
  1147.  
  1148.  
  1149.  
  1150. set ppp <iface> login <name> <password>
  1151.  
  1152.     Specifies the name and password to use for authentication as
  1153.     a client.
  1154.  
  1155.  
  1156.  
  1157. set ppp <iface> peerip <IP address>
  1158.  
  1159.     Specifies the IP address that will be assigned to the remote
  1160.     peer during IPCP negotiation.  If you do not set this option
  1161.     then any address will be accepted.
  1162.  
  1163.  
  1164.  
  1165. set ppp <iface> trace {off,on}
  1166.  
  1167.     Controls the logging of PPP trace information for the
  1168.     specified interface.  When enabled, the PPP negotiation
  1169.     information will be logged.  This is helpful when
  1170.     analyzing PPP problems.
  1171.  
  1172.  
  1173.  
  1174. set ppp <iface> vjtcp {off,on}
  1175.  
  1176.     Controls the negotiation of Van Jacobson TCP/IP header
  1177.     compression.  When turned off, this feature disables
  1178.     VJTCP in both directions.  This feature is on by default.
  1179.  
  1180.  
  1181.  
  1182. set trace {off,on}
  1183.  
  1184.     Controls logging of script commands.  This is very
  1185.     useful for debugging all sorts of scripts.  The
  1186.     default is off.
  1187.  
  1188.  
  1189.  
  1190. show arp
  1191.  
  1192.     Displays the ARP table.
  1193.  
  1194.  
  1195.  
  1196. show filter <iface>
  1197.  
  1198.     Shows the filter list and match counts for an interface.
  1199.  
  1200.  
  1201.  
  1202. show interface [<iface>]
  1203.  
  1204.     Shows various interface parameters and counters.
  1205.  
  1206.  
  1207.  
  1208. show nat <iface> [status] [debug]
  1209.  
  1210.     Shows the static NAT list, or the dynamic connection
  1211.     table with the "status" parameter.
  1212.  
  1213.  
  1214.  
  1215. show options
  1216.  
  1217.     Displays various compile-time options, and the values of
  1218.     some settable features that cannot be viewed elsewhere.
  1219.  
  1220.  
  1221.  
  1222. show route
  1223.  
  1224.     Displays the routing table.
  1225.  
  1226.  
  1227.  
  1228. show task
  1229.  
  1230.     Displays the active task list.
  1231.  
  1232.  
  1233.  
  1234. show version
  1235.  
  1236.     Displays the version identification message.
  1237.  
  1238.  
  1239.  
  1240. shutdown
  1241.  
  1242.     Shuts down the router software.
  1243.  
  1244.  
  1245.  
  1246. slip <iface> <timeout> <addr/bits> [broadcast <brdcst addr>] [mtu <mtu>]
  1247.         [compress] [allow-compress]
  1248.  
  1249.     Starts SLIP on the specified interface.  The interface
  1250.     will revert to "raw" mode if no packets are received for
  1251.     <timeout> seconds, or if a carrier drop is detected.  The
  1252.         IP address and mask are treated like the ones in the
  1253.     "packet" command.  The default SLIP MTU is 1006 bytes (as
  1254.     per RFC 1055).  If the optional "compress" keyword is
  1255.     specified then Van Jacobson TCP header compression will
  1256.     be performed.  If "allow-compress" is specified then Van
  1257.     Jacobson TCP header compression will be enabled only if
  1258.     it is detected from the remote end of the link.
  1259.  
  1260.     If this command is typed in to a command interpreter then
  1261.     a new process will be started to execute the command.  If
  1262.     this command is part of a script then script execution
  1263.     will pause until the interface reverts to raw mode.  If
  1264.     this was due to a timeout or carrier drop then any enabled
  1265.     "on" event for these conditions will be taken.
  1266.  
  1267.  
  1268.  
  1269. tip <iface>
  1270.  
  1271.     Connects to a "raw" interface.  Sometimes useful for
  1272.     configuring modems and stuff.  Type ^] to exit.  This
  1273.     will not work as expected if a script is running.
  1274.  
  1275.  
  1276.  
  1277. tunnel <iface> <addr/bits> esp <remote addr> [mtu <mtu>]
  1278.  
  1279.     Creates a tunnel driver that uses the specified address
  1280.     and prefix width as its tunnel endpoint, and that
  1281.     tunnels to the specified remote IP address.  At this time
  1282.     only ESP tunnelling is supported.
  1283.  
  1284.  
  1285.  
  1286. user <username> <password> <addr/bits>
  1287.  
  1288.     Creates a user entry for inbound authentication with
  1289.     CHAP or PAP.  The IP address and prefix width are not
  1290.     used at this time.
  1291.  
  1292.  
  1293.  
  1294. wait <iface> <timeout> [exact] [<string>]
  1295.  
  1296.     Waits for the timeout to expire, or the string to be
  1297.     matched, or an enabled "on" event to occur.
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.     EXAMPLE ROUTER CONFIGURATION USING SLIP
  1305.  
  1306. ;
  1307. ;   IPR script for example configuration.
  1308. ;
  1309. ;   Configure ethernet interface on network 192.168.0.0/24
  1310.     packet en0 0x60 192.168.0.254/24
  1311. ;   Configure my modem port and make it the default route
  1312.     async sl0 0x3f8 4 57600 do_sl0
  1313.     route * sl0 perm
  1314. ;   Broadcast RIP routes on the ethernet
  1315.     rip en0
  1316. ;   Start a command interpreter on the console
  1317.     command
  1318.     exit
  1319.  
  1320. ;
  1321. ;   Script for filter and NAT configuration on sl0,
  1322. ;   with demand dial out, etc.
  1323. ;
  1324. do_sl0:
  1325.     set trace on
  1326. ;
  1327. ;   Set up packet filtering.
  1328. ;
  1329. ;   Allow established TCP
  1330.     filter permit in tcp-xsyn !192.168.0.0/22 38.145.214.209
  1331. ;   Drop and log attempts to spoof internal addresses, or our external address
  1332.     filter log drop in * 192.168.0.0/22 *
  1333.     filter log drop in * 38.145.214.209 *
  1334. ;   Allow UDP responses.  NAT will keep out unsolicited packets.
  1335.     filter permit in udp * 38.145.214.209
  1336. ;   Allow incoming mail and FTP connections
  1337.     filter permit in tcp-syn * 38.145.214.209:25
  1338.     filter permit in tcp-syn * 38.145.214.209:21
  1339.     filter permit in tcp-syn *:20 38.145.214.209
  1340. ;   Allow DNS zone transfers from 192.33.4.10
  1341.     filter permit in tcp-syn 192.33.4.10 38.145.214.209:53
  1342. ;   Drop and log everything else.
  1343.     filter log drop in * * *
  1344.  
  1345. ;
  1346. ;   Set up NAT
  1347. ;
  1348. ;   Allow SMTP mail to come in.
  1349.     nat tcp 192.168.0.69:25 38.145.214.209:25
  1350. ;   Allow FTP requests to be serviced.
  1351.     nat tcp 192.168.0.69:21 38.145.214.209:21
  1352.     nat tcp 192.168.0.69:20 38.145.214.209:20
  1353. ;   Allow DNS zone transfers (packet filtering controls with whom).
  1354.     nat tcp 192.168.0.69:53 38.145.214.209:53
  1355. ;   Allow all outgoing service requests and their responses.
  1356.     nat * * 38.145.214.209
  1357.  
  1358. ;
  1359. ;   Configure modem control and set up for demand dial.
  1360. ;
  1361.     set interface rts flow
  1362. hangup:
  1363.     set interface dtr off
  1364.     delay .5
  1365.     set interface dtr on
  1366.     on packet dialout
  1367.     wait 0
  1368.  
  1369. ;
  1370. ;   Dial the phone, log in, and run SLIP.
  1371. ;   Hang up if no packets are received for 10 minutes.
  1372. ;
  1373. dialout:
  1374.     send "ATDT 555-1212\r"
  1375.     wait 1
  1376.     on timeout hangup
  1377.     wait 45 "CONNECT"
  1378. ;   Read the rest of the CONNECT message into symbol "speed".
  1379.     on cd lineup
  1380.     read 5 "\r" speed
  1381.     wait 60
  1382. lineup:    on cdloss hangup
  1383.     on timeout hangup
  1384.     send "\r\r"
  1385.     wait 5 "Username: "
  1386.     send "IWantToBeA\r"
  1387.     wait 5 "Password: "
  1388.     send "Schutzhund3\r"
  1389.     wait 5 "Local> "
  1390.     send "CONNECT SLIP\r"
  1391.     log "Connected at $speed"
  1392.     slip 600 38.145.214.209/24 mtu 1006
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.     EXAMPLE ROUTER CONFIGURATION USING PPP (STATIC)
  1399.  
  1400. ;
  1401. ;   IPR script for example configuration with PPP
  1402. ;   using a static IP address.
  1403. ;
  1404. ;   Configure ethernet interface on network 192.168.0.0/24
  1405.     packet en0 0x60 192.168.0.254/24
  1406. ;   Configure my modem port and make it the default route
  1407.     async sl0 0x3f8 4 57600 do_sl0
  1408.     route * sl0 perm
  1409. ;   Broadcast RIP routes on the ethernet
  1410.     rip en0
  1411. ;   Start a command interpreter on the console
  1412.     command
  1413.     exit
  1414.  
  1415. ;
  1416. ;   Script for filter and NAT configuration on sl0,
  1417. ;   with demand dial out, etc.
  1418. ;
  1419. do_sl0:
  1420.     set trace on
  1421. ;
  1422. ;   Set up packet filtering.
  1423. ;
  1424. ;   Allow established TCP
  1425.     filter permit in tcp-xsyn !192.168.0.0/22 38.145.214.209
  1426. ;   Drop and log attempts to spoof internal addresses, or our external address
  1427.     filter log drop in * 192.168.0.0/22 *
  1428.     filter log drop in * 38.145.214.209 *
  1429. ;   Allow UDP responses.  NAT will keep out unsolicited packets.
  1430.     filter permit in udp * 38.145.214.209
  1431. ;   Allow incoming mail and FTP connections
  1432.     filter permit in tcp-syn * 38.145.214.209:25
  1433.     filter permit in tcp-syn * 38.145.214.209:21
  1434.     filter permit in tcp-syn *:20 38.145.214.209
  1435. ;   Allow DNS zone transfers from 192.33.4.10
  1436.     filter permit in tcp-syn 192.33.4.10 38.145.214.209:53
  1437. ;   Drop and log everything else.
  1438.     filter log drop in * * *
  1439.  
  1440. ;
  1441. ;   Set up NAT
  1442. ;
  1443. ;   Allow SMTP mail to come in.
  1444.     nat tcp 192.168.0.69:25 38.145.214.209:25
  1445. ;   Allow FTP requests to be serviced.
  1446.     nat tcp 192.168.0.69:21 38.145.214.209:21
  1447.     nat tcp 192.168.0.69:20 38.145.214.209:20
  1448. ;   Allow DNS zone transfers (packet filtering controls with whom).
  1449.     nat tcp 192.168.0.69:53 38.145.214.209:53
  1450. ;   Allow all outgoing service requests and their responses.
  1451.     nat * * 38.145.214.209
  1452.  
  1453. ;
  1454. ;   Configure modem control and set up for demand dial.
  1455. ;
  1456.     set interface rts flow
  1457. hangup:
  1458.     set interface dtr off
  1459.     delay .5
  1460.     set interface dtr on
  1461.     on packet dialout
  1462.     wait 0
  1463.  
  1464. ;
  1465. ;   Dial the phone, log in, and run PPP.
  1466. ;   Hang up if no packets are received for 10 minutes.
  1467. ;
  1468. dialout:
  1469.     send "ATDT 555-1212\r"
  1470.     wait 1
  1471.     on timeout hangup
  1472.     wait 45 "CONNECT"
  1473. ;   Read the rest of the CONNECT message into symbol "speed".
  1474.     on cd lineup
  1475.     read 5 "\r" speed
  1476.     wait 60
  1477. lineup:    on cdloss hangup
  1478.     on timeout hangup
  1479.     log "Connected at $speed"
  1480.     set ppp login mischler xerxes
  1481.     ppp 600 38.145.214.209/24
  1482.     goto hangup
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.     EXAMPLE ROUTER CONFIGURATION USING PPP (DYNAMIC)
  1489.  
  1490. ;
  1491. ;   IPR script for example configuration with PPP
  1492. ;   using a dynamically negotiated IP address.
  1493. ;
  1494. ;   Configure ethernet interface on network 192.168.0.0/24
  1495.     packet en0 0x60 192.168.0.254/24
  1496. ;   Configure my modem port and make it the default route
  1497.     async sl0 0x3f8 4 57600 do_sl0
  1498.     route * sl0 perm
  1499. ;   Broadcast RIP routes on the ethernet
  1500.     rip en0
  1501. ;   Start a command interpreter on the console
  1502.     command
  1503.     exit
  1504.  
  1505. ;
  1506. ;   Script for filter and NAT configuration on sl0,
  1507. ;   with demand dial out, etc.
  1508. ;
  1509. do_sl0:
  1510.     set trace on
  1511. ;
  1512. ;   Set up NAT
  1513. ;
  1514. ;   Allow all outgoing service requests and their responses.
  1515. ;   The IP address is not critical, but should be the most
  1516. ;   likely address (or at least a possible address).
  1517.     nat * * 38.145.214.209
  1518.  
  1519. ;
  1520. ;   Configure modem control and set up for demand dial.
  1521. ;
  1522.     set interface rts flow
  1523. hangup:
  1524.     set interface dtr off
  1525.     delay .5
  1526.     set interface dtr on
  1527.     on packet dialout
  1528.     wait 0
  1529.  
  1530. ;
  1531. ;   Dial the phone, log in, and run PPP.
  1532. ;   Hang up if no packets are received for 10 minutes.
  1533. ;
  1534. dialout:
  1535.     send "ATDT 555-1212\r"
  1536.     wait 1
  1537.     on timeout hangup
  1538.     wait 45 "CONNECT"
  1539. ;   Read the rest of the CONNECT message into symbol "speed".
  1540.     on cd lineup
  1541.     read 5 "\r" speed
  1542.     wait 60
  1543. lineup:    on cdloss hangup
  1544.     on timeout hangup
  1545.     log "Connected at $speed"
  1546.     set ppp login mischler xerxes
  1547.     ppp 600 * dynamic-nat
  1548.     goto hangup
  1549.  
  1550.  
  1551.  
  1552.     EXAMPLE AUTOEXEC.BAT
  1553.  
  1554. rem  Load packet driver and start IPR.
  1555. smc_wd 0x60 10 0x280 0xd000
  1556. ipr script.ipr
  1557.  
  1558.